package com.lixian.mypro;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.bumptech.glide.Glide;

/**
 * Created by Administrator on 2018/2/11.
 */

public class ToastUtils {

    public static final int CAHAN=1;
    public static final int SE=2;
    public static final int JINGGAO=3;


    public static void toast(String content, Context context, int during){
        Context context1 = context.getApplicationContext();
        View view = LayoutInflater.from(context1).inflate(R.layout.toast_layout, null, false);
        ImageView icon= (ImageView) view.findViewById(R.id.image_icon);


        TextView text= (TextView) view.findViewById(R.id.image_content);
        text.setText(content);
        Glide.with(context1).load(R.drawable.toast_cahan).into(icon);
        Toast toast=new Toast(context1);
        toast.setView(view);
        toast.setDuration(during);
        toast.show();
    }
}
